class AddForeignKeysToExam < ActiveRecord::Migration
  def self.up
    add_column :exam_questions, :exam_id, :integer
    add_column :exam_choices, :exam_question_id, :integer
    add_index(:exam_questions, :exam_id)
    add_index(:exam_choices, :exam_question_id)
  end

  def self.down
    remove_index :exam_questions, :exam_id
    remove_index :exam_choices, :exam_question_id
    remove_column(:exam_questions, :exam_id)
    remove_column(:exam_choices, :exam_question_id)
  end
end
